package com.cloud.code.算法.线性查找法;

public class Test {

    public static void main(String[] args) {

        System.out.println(5/2);
        System.out.println(5%2);

        binaryToDecimal(10);

        btd(10);
    }

    public static void binaryToDecimal(int n){
        String str = "";
        while(n!=0){
            str = n%2+str;
            n = n/2;
        }
        System.out.println(str);
    }


    public static void btd(int n){
        String res = "";
        while (n != 0){
            res = n%2+res;
            n= n/2;
        }

        System.out.println(res);
    }
}
